package ads_api

import (
	"server/global"
)

type AdsApi struct {
	global.BaseModel
	ApiName    string `json:"apiName" form:"apiName" gorm:"column:api_name;comment:API名称;size:255;"`
	ApiUrl     string `json:"apiUrl" form:"apiUrl" gorm:"column:api_url;comment:API路径;size:255;"`
	ApiVersion string `json:"apiVersion" form:"apiVersion" gorm:"column:api_version;comment:API版本;size:10;"`
	ConfigJson string `json:"configJson" form:"configJson" gorm:"column:config_json;comment:执行配置;size:2000;"`
	CreateDept string `json:"createDept" form:"createDept" gorm:"column:create_dept;comment:创建人所属部门;size:50;"`
	Deny       string `json:"deny" form:"deny" gorm:"column:deny;comment:IP黑名单多个，隔开;size:2000;"`
	LimitJson  string `json:"limitJson" form:"limitJson" gorm:"column:limit_json;comment:限流配置;size:1000;"`
	Remark     string `json:"remark" form:"remark" gorm:"column:remark;comment:备注;size:1000;"`
	ReqJson    string `json:"reqJson" form:"reqJson" gorm:"column:req_json;comment:请求参数;size:2000;"`
	ReqMethod  string `json:"reqMethod" form:"reqMethod" gorm:"column:req_method;comment:请求方式;size:10;"`
	ResJson    string `json:"resJson" form:"resJson" gorm:"column:res_json;comment:返回参数;size:2000;"`
	ResType    string `json:"resType" form:"resType" gorm:"column:res_type;comment:返回格式;size:10;"`
	Status     *bool  `json:"status" form:"status" gorm:"column:status;comment:状态（0不启用，1启用）;"`
	CreatedBy  uint   `gorm:"column:created_by;comment:创建者"`
	UpdatedBy  uint   `gorm:"column:updated_by;comment:更新者"`
	DeletedBy  uint   `gorm:"column:deleted_by;comment:删除者"`
}

func (AdsApi) TableName() string {
	return "ads_api"
}
